/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.moravian.UI.game;

import edu.moravian.UI.entity.BallEntityView;
import edu.moravian.entity.BallEntity;
import edu.moravian.entity.BallEntityManager;
import edu.moravian.world.World2D;
import edu.moravian.world.WorldDescriptor;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 *
 * @author Elliot
 */
public class BouncingBallGameView 
{
    private WorldDescriptor world;
    private List<BallEntityView> balls;
    
    public BouncingBallGameView(WorldDescriptor world, BallEntityManager ballsModel)
    {
        this.world = world;
        
        balls = new ArrayList<BallEntityView>();
        
        rand = new Random();
        for(BallEntity ball: ballManager.getBalls())
        {
            Color color = new Color((int)randInRange(0, 255), (int)randInRange(0, 255), (int)randInRange(0, 255)); 
            balls.add(new edu.moravian.UI.entity.BallEntityView(ball, color));
        }
    }
    
    public void draw(World2D w2d)
    {
        w2d.setColor(Color.WHITE);
        w2d.drawCenteredRectangle(world.getCenter(), world.getWidth(), world.getHeight());
    }
}
